Summary of the Slot Manager
Pascal Summary
Constants
CONST {siStatusFlags field of SInfoRecord} fCardIsChanged = 1; {card has changed} {flags for SSearchSRT} fCkForSame = 0; {check for same sResource in table} fCkForNext = 1; {check for next sResource in table} {flag passed to card by SPrimaryInit during startup or restart} fWarmStart = 2; {warm start if set; else cold start} {constants for siState field of sInfoRecord} stateNil = 0; {state} stateSDMInit = 1; {slot declaration manager init} statePRAMInit = 2; {sPRAM record init} statePInit = 3; {primary init} stateSInit = 4; {secondary init} {bit flags for spParamData field of SpBlock} fAll = 0; {if set, search all sResources} fOneSlot = 1; {if set, search in given slot only} fNext = 2; {if set, search for next sResource}Data Types
TYPE SpBlock = {Slot Manager parameter block} PACKED RECORD spResult: LongInt; {function result} spsPointer: Ptr; {structure pointer} spSize: LongInt; {size of structure} spOffsetData: LongInt; {offset or data} spIOFileName: Ptr; {reserved for Slot Manager} spsExecPBlk: Ptr; {pointer to SEBlock data structure} spParamData: LongInt; {flags} spMisc: LongInt; {reserved for Slot Manager} spReserved: LongInt; {reserved for Slot Manager} spIOReserved: Integer; {ioReserved field from SRT} spRefNum: Integer; {driver reference number} spCategory: Integer; {Category field of sRsrcType entry} spCType: Integer; {cType field of sRsrcType entry} spDrvrSW: Integer; {DrSW field of sRsrcType entry} spDrvrHW: Integer; {DrHW field of sRsrcType entry} spTBMask: SignedByte; {sRsrcType entry bit mask} spSlot: SignedByte; {slot number} spID: SignedByte; {sResource ID} spExtDev: SignedByte; {external device ID} spHwDev: SignedByte; {hardware device ID} spByteLanes: SignedByte; {valid byte lanes} spFlags: SignedByte; {flags used by Slot Manager} spKey: SignedByte; {reserved for Slot Manager} END; SpBlockPtr = ^SpBlock; SInfoRecord = {slot information record} PACKED RECORD siDirPtr: Ptr; {pointer to sResource directory} siInitStatusA: Integer; {initialization error} siInitStatusV: Integer; {status returned by vendor } { initialization routine} siState: SignedByte; {initialization state} siCPUByteLanes: SignedByte; {byte lanes used} siTopOfROM: SignedByte; {highest valid address in ROM} siStatusFlags: SignedByte; {status flags} siTOConstant: Integer; {timeout constant for bus error} siReserved: PACKED ARRAY [0..1] OF SignedByte; {reserved} siROMAddr: Ptr; {address of top of ROM} siSlot: Char; {slot number} siPadding: PACKED ARRAY [0..2] OF SignedByte; {reserved} END; SInfoRecPtr = ^SInfoRecord; FHeaderRec = {format header record} PACKED RECORD fhDirOffset: LongInt; {offset to sResource directory} fhLength: LongInt; {length in bytes of declaration ROM} fhCRC: LongInt; {cyclic redundancy check} fhROMRev: SignedByte; {declaration ROM revision} fhFormat: SignedByte; {declaration ROM format} fhTstPat: LongInt; {test pattern} fhReserved: SignedByte; {reserved; must be 0} fhByteLanes: SignedByte; {byte lanes used by declaration ROM} END; FHeaderRecPtr = ^FHeaderRec; SPRAMRecord = {slot parameter RAM record} PACKED RECORD boardID: Integer; {Apple-defined card ID} vendorUse1: SignedByte; {reserved for vendor use} vendorUse2: SignedByte; {reserved for vendor use} vendorUse3: SignedByte; {reserved for vendor use} vendorUse4: SignedByte; {reserved for vendor use} vendorUse5: SignedByte; {reserved for vendor use} vendorUse6: SignedByte; {reserved for vendor use} END; SPRAMRecPtr = ^SPRAMRecord; SEBlock = {slot execution parameter block} PACKED RECORD seSlot: SignedByte; {slot number} sesRsrcId: SignedByte; {sResource ID} seStatus: Integer; {status of sExecBlock code} seFlags: SignedByte; {flags} seFiller0: SignedByte; {filler for word alignment} seFiller1: SignedByte; {filler} seFiller2: SignedByte; {filler} seResult: LongInt; {result of SLoadDriver} seIOFileName: LongInt; {pointer to driver name} seDevice: SignedByte; {device to read from} sePartition: SignedByte; {partition} seOSType: SignedByte; {type of OS} seReserved: SignedByte; {reserved} seRefNum: SignedByte; {driver reference number} seNumDevices: SignedByte; {number of devices to load} seBootState: SignedByte; {state of StartBoot code} END; SlotIntQElement = {slot interrupt queue element} RECORD sqLink: Ptr; {pointer to next queue element} sqType: Integer; {queue type ID; must be sIQType} sqPrio: Integer; {priority value in low byte} sqAddr: ProcPtr; {interrupt handler} sqParm: LongInt; {optional A1 parameter} END; SQElemPtr = ^SlotIntQElement;Slot Manager Routines
Determining the Version of the Slot Manager
FUNCTION SVersion (spBlkPtr: SpBlockPtr): OSErr;Finding sResources
FUNCTION SRsrcInfo (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SGetSRsrc (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SGetTypeSRsrc (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SNextSRsrc (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SNextTypeSRsrc (spBlkPtr: SpBlockPtr): OSErr;Getting Information From sResources
FUNCTION SReadDrvrName (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SReadByte (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SReadWord (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SReadLong (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SGetCString (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SGetBlock (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SFindStruct (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SReadStruct (spBlkPtr: SpBlockPtr): OSErr;Enabling, Disabling, Deleting, and Restoring sResources
FUNCTION SetSRsrcState (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SDeleteSRTRec (spBlkPtr: SpBlockPtr): OSErr; FUNCTION InsertSRTRec (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SUpdateSRT (spBlkPtr: SpBlockPtr): OSErr;Loading Drivers and Executing Code From sResources
FUNCTION SGetDriver (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SExec (spBlkPtr: SpBlockPtr): OSErr;Getting Information About Expansion Cards and Declaration ROMs
FUNCTION SReadInfo (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SReadFHeader (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SCkCardStat (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SCardChanged (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SFindDevBase (spBlkPtr: SpBlockPtr): OSErr;Accessing Expansion Card Parameter RAM
FUNCTION SReadPRAMRec (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SPutPRAMRec (spBlkPtr: SpBlockPtr): OSErr;Managing the Slot Interrupt Queue
FUNCTION SIntInstall (sIntQElemPtr: SQElemPtr; theSlot: Integer) : OsErr; FUNCTION SIntRemove (sIntQElemPtr: SQElemPtr; theSlot: Integer) : OsErr;Low-Level Routines
FUNCTION InitSDeclMgr (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SCalcSPointer (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SCalcStep (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SFindBigDevBase (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SFindSInfoRecPtr (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SFindSRsrcPtr (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SGetSRsrcPtr (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SInitPRAMRecs (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SInitSRsrcTable (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SOffsetData (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SPrimaryInit (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SPtrToSlot (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SReadPBSize (spBlkPtr: SpBlockPtr): OSErr; FUNCTION SSearchSRT (spBlkPtr: SpBlockPtr): OSErr;C Summary
Constants
enum { /* StatusFlags field of sInfoArray */ fCardIsChanged = 1, /* card has changed */ /* flags for SearchSRT */ fCkForSame = 0, /* check for same sResource in table */ fCkForNext = 1, /* check for next sResource in table */ /* flag passed to card by SPrimaryInit during startup or restart */ fWarmStart = 2, /* warm start if set; else cold start */ /* constants for siState field of sInfoRecord */ stateNil = 0, /* state */ stateSDMInit = 1, /* slot declaration manager init */ statePRAMInit = 2, /* sPRAM record init */ statePInit = 3, /* primary init */ stateSInit = 4, /* secondary init */ /* bit flags for spParamData field of SpBlock */ fall = 0, /* if set, search all sResources */ foneslot = 1, /* if set, search in given slot only */ fnext = 2 /* if set, search for next sResource */ };Data Types
typedef struct SpBlock { /* Slot Manager parameter block */ long spResult; /* function result */ Ptr spsPointer; /* structure pointer */ long spSize; /* size of structure */ long spOffsetData; /* offset or data */ Ptr spIOFileName; /* reserved for Slot Manager */ Ptr spsExecPBlk; /* pointer to SEBlock structure */ long spParamData; /* flags */ long spMisc; /* reserved for Slot Manager */ long spReserved; /* reserved for Slot Manager */ short spIOReserved; /* ioReserved field from SRT */ short spRefNum; /* driver reference number */ short spCategory; /* Category field of sRsrcType entry */ short spCType; /* cType field of sRsrcType entry */ short spDrvrSW; /* DrSW field of sRsrcType entry */ short spDrvrHW; /* DrHW field of sRsrcType entry */ char spTBMask; /* sRsrcType entry bit mask */ char spSlot; /* slot number */ char spID; /* sResource ID */ char spExtDev; /* external device ID */ char spHwDev; /* hardware device ID */ char spByteLanes; /* valid byte lanes */ char spFlags; /* flags used by Slot Manager */ char spKey; /* reserved for Slot Manager */ } SpBlock; typedef SpBlock *SpBlockPtr; typedef struct SInfoRecord { /* slot information record */ Ptr siDirPtr; /* pointer to sResource directory */ short siInitStatusA; /* initialization error */ short siInitStatusV; /* status returned by vendor initialization routine */ char siState; /* initialization state */ char siCPUByteLanes; /* byte lanes used */ char siTopOfROM; /* highest valid address in ROM */ char siStatusFlags; /* status flags */ short siTOConst; /* timeout constant for bus error */ char siReserved[2]; /* reserved */ Ptr siROMAddr; /* address of top of ROM */ char siSlot; /* slot number */ char siPadding[3]; /* reserved */ } SInfoRecord; typedef SInfoRecord *SInfoRecPtr; typedef struct FHeaderRec { /* format header record */ long fhDirOffset; /* offset to sResource directory */ long fhLength; /* length in bytes of declaration ROM */ long fhCRC; /* cyclic redundancy check */ char fhROMRev; /* declaration ROM revision */ char fhFormat; /* declaration ROM format */ long fhTstPat; /* test pattern */ char fhReserved; /* reserved; must be 0 */ char fhByteLanes; /* byte lanes used by declaration ROM */ } FHeaderRec; typedef FHeaderRec *FHeaderRecPtr; typedef struct SPRAMRecord { /* slot parameter RAM record */ short boardID; /* Apple-defined card ID */ char vendorUse1; /* reserved for vendor use */ char vendorUse2; /* reserved for vendor use */ char vendorUse3; /* reserved for vendor use */ char vendorUse4; /* reserved for vendor use */ char vendorUse5; /* reserved for vendor use */ char vendorUse6; /* reserved for vendor use */ } SPRAMRecord; typedef SPRAMRecord *SPRAMRecPtr; typedef struct SEBlock { /* slot execution parameter block */ unsigned char seSlot; /* slot number */ unsigned char sesRsrcId; /* sResource ID */ short seStatus; /* status of sExecBlock code */ unsigned char seFlags; /* flags */ unsigned char seFiller0; /* filler for word alignment */ unsigned char seFiller1; /* filler */ unsigned char seFiller2; /* filler */ long seResult; /* result of SLoadDriver */ long seIOFileName; /* pointer to driver name */ unsigned char seDevice /* device to read from */ unsigned char sePartition; /* partition */ unsigned char seOSType; /* type of OS */ unsigned char seReserved; /* reserved */ unsigned char seRefNum; /* driver reference number */ unsigned char seNumDevices; /* number of devices to load */ unsigned char seBootState; /* state of StartBoot code */ } SEBlock; typedef struct SlotIntQElement { /* slot interrupt queue element */ Ptr sqLink; /* pointer to next queue element */ short sqType; /* queue type ID; must be sIQType */ short sqPrio; /* priority value in low byte */ ProcPtr sqAddr; /* interrupt handler */ long sqParm; /* optional A1 parameter */ } SlotIntQElement; typedef SlotIntQElement *SQElemPtr;Slot Manager Functions
Determining the Version of the Slot Manager
pascal OSErr SVersion (SpBlockPtr spBlkPtr);Finding sResources
pascal OSErr SRsrcInfo (SpBlockPtr spBlkPtr); pascal OSErr SGetSRsrc (SpBlockPtr spBlkPtr); pascal OSErr SGetTypeSRsrc (SpBlockPtr spBlkPtr); pascal OSErr SNextSRsrc (SpBlockPtr spBlkPtr); pascal OSErr SNextTypeSRsrc (SpBlockPtr spBlkPtr);Getting Information From sResources
pascal OSErr SReadDrvrName (SpBlockPtr spBlkPtr); pascal OSErr SReadByte (SpBlockPtr spBlkPtr); pascal OSErr SReadWord (SpBlockPtr spBlkPtr); pascal OSErr SReadLong (SpBlockPtr spBlkPtr); pascal OSErr SGetCString (SpBlockPtr spBlkPtr); pascal OSErr SGetBlock (SpBlockPtr spBlkPtr); pascal OSErr SFindStruct (SpBlockPtr spBlkPtr); pascal OSErr SReadStruct (SpBlockPtr spBlkPtr);Enabling, Disabling, Deleting, and Restoring sResources
pascal OSErr SetSRsrcState (SpBlockPtr spBlkPtr); pascal OSErr SDeleteSRTRec (SpBlockPtr spBlkPtr); pascal OSErr InsertSRTRec (SpBlockPtr spBlkPtr); pascal OSErr SUpdateSRT (SpBlockPtr spBlkPtr);Loading Drivers and Executing Code From sResources
pascal OSErr SGetDriver (SpBlockPtr spBlkPtr); pascal OSErr SExec (SpBlockPtr spBlkPtr);Getting Information About Expansion Cards and Declaration ROMs
pascal OSErr SReadInfo (SpBlockPtr spBlkPtr); pascal OSErr SReadFHeader (SpBlockPtr spBlkPtr); pascal OSErr SCkCardStat (SpBlockPtr spBlkPtr); pascal OSErr SCardChanged (SpBlockPtr spBlkPtr); pascal OSErr SFindDevBase (SpBlockPtr spBlkPtr);Accessing Expansion Card Parameter RAM
pascal OSErr SReadPRAMRec (SpBlockPtr spBlkPtr); pascal OSErr SPutPRAMRec (SpBlockPtr spBlkPtr);Managing the Slot Interrupt Queue
pascal OSErr SIntInstall (SQElemPtr sIntQElemPtr, short theSlot); pascal OSErr SIntRemove (SQElemPtr sIntQElemPtr, short theSlot);Low-Level Functions
pascal OSErr InitSDeclMgr (SpBlockPtr spBlkPtr); pascal OSErr SCalcSPointer (SpBlockPtr spBlkPtr); pascal OSErr SCalcStep (SpBlockPtr spBlkPtr); pascal OSErr SFindBigDevBase (SpBlockPtr spBlkPtr); pascal OSErr SFindSInfoRecPtr (SpBlockPtr spBlkPtr); pascal OSErr SFindSRsrcPtr (SpBlockPtr spBlkPtr); pascal OSErr SGetSRsrcPtr (SpBlockPtr spBlkPtr); pascal OSErr SInitPRAMRecs (SpBlockPtr spBlkPtr); pascal OSErr SInitSRsrcTable (SpBlockPtr spBlkPtr); pascal OSErr SOffsetData (SpBlockPtr spBlkPtr); pascal OSErr SPrimaryInit (SpBlockPtr spBlkPtr); pascal OSErr SPtrToSlot (SpBlockPtr spBlkPtr); pascal OSErr SReadPBSize (SpBlockPtr spBlkPtr); pascal OSErr SSearchSRT (SpBlockPtr spBlkPtr);Assembly-Language Summary
Data Structures
Slot Manager Parameter Block
0 spResult
long function result 4 spsPointer
long structure pointer 8 spSize
long size of structure 12 SpOffsetData
long offset or data 16 spIOFileName
long reserved for Slot Manager 20 spsExecPBlk
long pointer to SEBlock data structure 24 spParamData
long flags 28 spMisc
long reserved for Slot Manager 32 spReserved
long reserved for Slot Manager 36 spIOReserved
word ioReserved
field from SRT38 spRefNum
word driver reference number 40 spCategory
word Category
field ofsRsrcType
entry42 spCType
word cType
field ofsRsrcType
entry44 spDrvrSW
word DrSW
field ofsRsrcType
entry46 spDrvrHW
word DrHW
field ofsRsrcType
entry48 spTBMask
byte sRsrcType
entry bit mask49 spSlot
byte slot number 50 spID
byte sResource ID 51 spExtDev
byte external device ID 52 spHwDev
byte hardware device ID 53 spByteLanes
byte valid byte lanes 54 spFlags
byte flags used by Slot Manager 55 spKey
byte reserved for Slot Manager Slot Information Record
0 siDirPtr
long pointer to sResource directory 4 siInitStatusA
word initialization error 6 siInitStatusV
word status returned by vendor initialization routine 8 siState
byte initialization state 9 siCPUByteLanes
byte byte lanes used 10 siTopOfROM
byte highest valid address in ROM 11 siStatusFlags
byte status flags 12 siTOConst
word timeout constant for bus error 14 siReserved
word reserved 16 siROMAddr
long address of top of ROM 20 siSlot
byte slot number 21 siPadding
3 bytes reserved Format Header Record
0 fhDirOffset
long offset to sResource directory 4 fhLength
long length in bytes of declaration ROM 8 fhCRC
long cyclic redundancy check 12 fhROMRev
byte declaration ROM revision 13 fhFormat
byte declaration ROM format 14 fhTstPat
long test pattern 18 fhReserved
byte reserved; must be 0 19 fhByteLanes
byte byte lanes used by declaration ROM Slot Parameter RAM Record
0 boardID
word Apple-defined card ID 2 vendorUse1
byte reserved for vendor use 3 vendorUse2
byte reserved for vendor use 4 vendorUse3
byte reserved for vendor use X vendorUse4
byte reserved for vendor use 6 vendorUse5
byte reserved for vendor use 7 vendorUse6
byte reserved for vendor use Slot Execution Parameter Block
0 seSlot
byte slot number 1 sesRsrcId
byte sResource ID 2 seStatus
word status of sExecBlock
code4 seFlags
byte flags X seFiller0
byte filler for word alignment 6 seFiller1
byte filler 7 seFiller2
byte filler 8 seResult
long result of SLoadDriver
12 seIOFileName
long pointer to driver name 16 seDevice
byte device to read from 17 sePartition
byte partition 18 seOSType
byte type of operating system 19 seReserved
byte reserved 20 seRefNum
byte driver reference number 21 seNumDevices
byte number of devices to load 22 seBootState
byte state of StartBoot
codeSlot Interrupt Queue Element
0 sqLink
long pointer to next queue element 4 sqType
word queue type ID; must be sIQType
6 sqPrio
word priority value in low byte
8 sqAddr
long pointer to interrupt handler 12 sqParm
long optional A1 parameter Trap Macros
Trap Macros Requiring Routine Selectors
_SlotManager
Selector Routine $0000 SReadByte
$0001 SReadWord
$0002 SReadLong
$0003 SGetCString
$0005 SGetBlock
$0006 SFindStruct
$0007 SReadStruct
$0008 SVersion $0009 SetSRsrcState $000A InsertSRTRec $000B SGetSRsrc $000C SGetTypeSRsrc $0010 SReadInfo
$0011 SReadPRAMRec
$0012 SPutPRAMRec
$0013 SReadFHeader
$0014 SNextSRsrc
$0015 SNextTypeSRsrc
$0016 SRsrcInfo
$0018 SCkCardStat
$0019 SReadDrvrName
$001B SFindDevBase
$001C SFindBigDevBase
$001D SGetSRsrcPtr $0020 InitSDeclMgr
$0021 SPrimaryInit
$0022 SCardChanged
$0023 SExec
$0024 SOffsetData
$0025 SInitPRAMRecs
$0026 SReadPBSize
$0028 SCalcStep
$0029 SInitSRsrcTable
$002A SSearchSRT
$002B SUpdateSRT
$002C SCalcSPointer
$002D SGetDriver
$002E SPtrToSlot
$002F SFindSInfoRecPtr
$0030 SFindSRsrcPtr
$0031 SDeleteSRTRec
Result Codes
noErr 0 No error memFullErr -108 Not enough room in heap smEmptySlot
-300 No card in this slot smCRCFail
-301 CRC check failed smFormatErr
-302 The format of the declaration ROM is wrong smUnExBusErr
-308 A bus error occurred smBLFieldBad
-309 A valid fhByteLanes
field was not foundsmDisposePErr
-312 An error occurred during execution of DisposePtr
smNoBoardsRsrc
-313 There is no board sResource smNoBoardId
-315 There is no board ID smInitStatVErr
-316 The InitStatusV
field was negative afterPrimaryInit
smBadRefId
-330 Reference ID was not found in the given list smBadsList
-331 The IDs are not in ascending order smReservedErr
-332 A reserved field was not zero smCodeRevErr
-333 The revision of the code to be executed by sExec
was wrongsmCPUErr
-334 The CPU field of the code to be executed by sExec
was wrongsmsPointerNil
-335 The spsPointer
value isNIL
: no list is specifiedsmNilsBlockErr
-336 The physical block size of an sBlock was zero smSlotOOBErr
-337 The given slot was out of bounds or does not exist smSelOOBErr
-338 Selector out of bounds or function not implemented smCkStatusErr
-341 Status of slot is bad smGetDrvrNamErr
-342 An error occurred during execution of _sGetDrvrName
smNoMoresRsrcs
-344 Requested sResource not found smBadsPtrErr
-346 Bad spsPointer
valuesmByteLanesErr
-347 Bad spByteLanes
valuesmRecNotFnd
-351 Record not found in the slot resource table
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help